package com.atguigu.builder.improve;

//指挥者 指定制作流程 生成产品
public class HouseDirector {

	// 拥有构建者 通过具体的构建者去创建产品
	HouseBuilder houseBuilder = null;

	public HouseDirector(HouseBuilder houseBuilder) {
		this.houseBuilder = houseBuilder;
	}

	/**
	 * 设置构建者
	 * @param houseBuilder
	 */
	public void setHouseBuilder(HouseBuilder houseBuilder) {
		this.houseBuilder = houseBuilder;
	}
	
	//指挥者控制 生产流程
	public House constructHouse() {
		houseBuilder.buildBasic();
		houseBuilder.buildWalls();
		houseBuilder.roofed();
		return houseBuilder.buildHouse();
	}
	
	
}
